import { BasicColumn, FormSchema } from "/@/components/Table";


export const columns: BasicColumn[] = [
  {
    title: '序号',
    dataIndex: 'id',
    width: 80,
  },
  {
    title: '用户姓名',
    dataIndex: 'name',
    width: '',
  },
  {
    title: '性别',
    dataIndex: 'gender',
    width: 100,
    customRender: ({ text }) => {
      let gender = 'unknown'
      if (text === 'male') {
        gender = '男'
      }
      if (text === 'female') {
        gender = '女'
      }
      return gender
    }
  },
  {
    title: '所属单位',
    dataIndex: 'organization',
    width: '',
  },
  {
    title: '单位编码',
    dataIndex: 'orgCode',
    width: ''
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: '',
    align: 'left'
  },
]

export const myCol = [
  {
    title: 'ID',
    dataIndex: 'id',
    width: 80,
  },
  {
    title: '用户姓名',
    dataIndex: 'name',
    width: '',
  },
  {
    title: '性别',
    dataIndex: 'gender',
    width: 100,
    customRender: ({ text }) => {
      let gender = 'unknown'
      if (text === 'male') {
        gender = '男'
      }
      if (text === 'female') {
        gender = '女'
      }
      return gender
    }
  },
  {
    title: '所属单位',
    dataIndex: 'organization',
    width: '',
  },
  {
    title: '单位编码',
    dataIndex: 'orgCode',
    width: ''
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: '',
    align: 'left'
  },
]

export const myCol2 = [
  {
    title: 'ID',
    dataIndex: 'id',
    width: 80,
  },
  {
    title: '用户姓名',
    dataIndex: 'name',
    width: '',
  },
  {
    title: '性别',
    dataIndex: 'gender',
    width: 100,
    customRender: ({ text }) => {
      let gender = 'unknown'
      if (text === 'male') {
        gender = '男'
      }
      if (text === 'female') {
        gender = '女'
      }
      return gender
    }
  },
  {
    title: '所属单位-ababab',
    dataIndex: 'organization',
    width: '',
  },
  // {
  //   title: '单位编码',
  //   dataIndex: 'orgCode',
  //   width: ''
  // },
  {
    title: '备注',
    dataIndex: 'remark',
    width: '',
    align: 'left'
  },
]

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '姓名',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'gender',
    label: '性别',
    component: 'Select',
    colProps: { span: 6 },
    componentProps: {
      options: [
        {
          label: '男',
          value: 'male',
          key: 1,
        },
        {
          label: '女',
          value: 'female',
          key: 2,
        },
      ],
    },
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'name',
    label: '用户姓名',
    component: 'Input',
    required: true,
  },
  {
    field: 'gender',
    label: '性别',
    component: 'Select',
    componentProps: {
      options: [
        {
          label: '男',
          value: 'male',
          key: 1,
        },
        {
          label: '女',
          value: 'female',
          key: 2,
        },
      ],
    },
  },
  {
    field: 'organization',
    label: '所属单位',
    component: 'Input'
  },
  {
    field: 'remark',
    label: '备注',
    component: 'InputTextArea'
  },
]